package model;

import java.util.HashMap;
import java.util.Observable;
import java.util.Observer;

class Pipe implements Observer{
	
	private HashMap<String, Integer> content = new HashMap<String, Integer>();
	private HashMap<String, Integer> NewContent = new HashMap<String, Integer>();
	
	public void setData(String name, int data) {
		NewContent.put(name, data);
	}
	
	public int getData(String name){
		return content.get(name);
	}
	
	public void execute(){
		content.clear();
		content.putAll(NewContent);
	}

	public void update(Observable o, Object arg) {
		execute();
	}
	
}
